package com.baiyue.entity;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.sql.Time;
import java.time.LocalTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.Version;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

/**
 * 计费规则实体类
 * @author 伍波
 * @date 2024-04-30
 */
@Data
@TableName("toll_rules")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class TollRules implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id，自动递增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 计费名称
     */
    @TableField("billing_name")
    private String billingName;
    /**
     * 计费规则，0-包段计费（每X小时计费X元）
     */
    @TableField("rule_type")
    private Integer ruleType;
    /**
     * 计费规则时间-指每X小时
     */
    @TableField("rule_time")
    private Integer ruleTime;
    /**
     * 计费规则金钱-指计费X元
     */
    @TableField("rule_money")
    private Integer ruleMoney;
    /**
     * 超时每小时计费X元
     */
    @TableField("timeout_money")
    private Integer timeoutMoney;
    /**
     * 超时后，免费时长
     */
    @TableField("timeout_free_time")
    private Integer timeoutFreeTime;
    /**
     * 夜间服务费
     */
    @TableField("night_serve_money")
    private Integer nightServeMoney;
    /**
     * 夜间服务开始时间
     */
    @TableField("night_serve_start")
    private Time nightServeStart;
    /**
     * 夜间服务停止时间
     */
    @TableField("night_serve_stop")
    private Time nightServeStop;
    /**
     * 夜间服务费免费时长
     */
    @TableField("night_serve_free_time")
    private Integer nightServeFreeTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @TableField("create_by")
    private String createBy;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 更新人
     */
    @TableField("update_by")
    private String updateBy;

    /**
     * 状态，0-正常，1-删除
     */
    private Integer status;


    /**
     * 开始时间
     */
    @TableField(exist = false)
    private String start;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private String end;

    /**
     * 排序字段
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortField;

    /**
     * 排序顺序
     * desc  asc
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortValue;

    public TollRules(String billingName, Integer ruleType, Integer ruleTime, Integer ruleMoney, Integer timeoutMoney,
                     Integer timeoutFreeTime, Integer nightServeMoney, Time nightServeStart, Time nightServeStop,
                     Integer nightServeFreeTime,Date createTime, String createBy, Date updateTime, String updateBy,
                     Integer status, String start, String end,String sortField, String sortValue) {
        this.billingName = billingName;
        this.ruleType = ruleType;
        this.ruleTime = ruleTime;
        this.ruleMoney = ruleMoney;
        this.timeoutMoney = timeoutMoney;
        this.timeoutFreeTime = timeoutFreeTime;
        this.nightServeMoney = nightServeMoney;
        this.nightServeStart = nightServeStart;
        this.nightServeStop = nightServeStop;
        this.nightServeFreeTime = nightServeFreeTime;
        this.createTime = createTime;
        this.createBy = createBy;
        this.updateTime = updateTime;
        this.updateBy = updateBy;
        this.status = status;
        this.start = start;
        this.end = end;
        this.sortField = sortField;
        this.sortValue = sortValue;
    }
}
